package com.live.video.server;

import com.live.video.mapper.GiftPlanMapper;
import com.live.video.model.GiftPlan;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Description:
 * User: godd
 * Date: 2017-11-14
 * Time: 21:27
 */
@Slf4j
@Service
public class GiftPlanServer implements BaseServer<GiftPlan> {

    @Autowired
    private GiftPlanMapper mapper;

    @Override
    public void save(GiftPlan giftPlan) {
        if (giftPlan.getId() != null) {
            mapper.updateByPrimaryKeySelective(giftPlan);
        } else {
            mapper.insert(giftPlan);
        }
    }

    @Override
    public GiftPlan queryOne(GiftPlan giftPlan) {
        return mapper.selectOne(giftPlan);
    }

    public List queryAll() {
        return null;
    }

    @Override
    public int remove(GiftPlan giftPlan) {
        return 0;
    }
}
